# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=dos2unix
pkgver=7.4.1
pkgrel=1
pkgdesc='Text file format converter'
arch=('i686' 'x86_64')
url='https://waterlan.home.xs4all.nl/dos2unix.html'
license=('BSD')
depends=('libintl')
groups=('base-devel')
makedepends=('perl' 'gettext-devel')
conflicts=('hd2u')
source=("https://waterlan.home.xs4all.nl/${pkgname}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('1cd58a60b03ed28fa39046102a185c5e88c4f7665e1e0417c25de7f8b9f78623')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DEBUG=1
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  install -Dm755 ${pkgdir}/usr/bin/dos2unix.exe ${pkgdir}/usr/bin/d2u.exe
  install -Dm755 ${pkgdir}/usr/bin/unix2dos.exe ${pkgdir}/usr/bin/u2d.exe
  install -D -m644 COPYING.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
